package com.ruoyi.project.beautyflower.userBankcard.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.beautyflower.userBankcard.mapper.UserBankcardMapper;
import com.ruoyi.project.beautyflower.userBankcard.domain.UserBankcard;
import com.ruoyi.project.beautyflower.userBankcard.service.IUserBankcardService;
import com.ruoyi.common.support.Convert;

/**
 * 用户绑定银行卡 服务层实现
 * 
 * @author lxs
 * @date 2018-10-12
 */
@Service
public class UserBankcardServiceImpl implements IUserBankcardService 
{
	@Autowired
	private UserBankcardMapper userBankcardMapper;

	/**
     * 查询用户绑定银行卡信息
     * 
     * @param id 用户绑定银行卡ID
     * @return 用户绑定银行卡信息
     */
    @Override
	public UserBankcard selectUserBankcardById(Integer id)
	{
	    return userBankcardMapper.selectUserBankcardById(id);
	}
	
	/**
     * 查询用户绑定银行卡列表
     * 
     * @param userBankcard 用户绑定银行卡信息
     * @return 用户绑定银行卡集合
     */
	@Override
	public List<UserBankcard> selectUserBankcardList(UserBankcard userBankcard)
	{
	    return userBankcardMapper.selectUserBankcardList(userBankcard);
	}
	
    /**
     * 新增用户绑定银行卡
     * 
     * @param userBankcard 用户绑定银行卡信息
     * @return 结果
     */
	@Override
	public int insertUserBankcard(UserBankcard userBankcard)
	{
	    return userBankcardMapper.insertUserBankcard(userBankcard);
	}
	
	/**
     * 修改用户绑定银行卡
     * 
     * @param userBankcard 用户绑定银行卡信息
     * @return 结果
     */
	@Override
	public int updateUserBankcard(UserBankcard userBankcard)
	{
	    return userBankcardMapper.updateUserBankcard(userBankcard);
	}

	/**
     * 删除用户绑定银行卡对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteUserBankcardByIds(String ids)
	{
		return userBankcardMapper.deleteUserBankcardByIds(Convert.toStrArray(ids));
	}

	/**
	 * 根据用户id查询银行卡列表
	 * @param userId
	 * @return
	 */
	@Override
	public List<UserBankcard> selectUserBankcardByUserId(String userId) {
		return userBankcardMapper.selectUserBankcardByUserId(userId);
	}


	/**
	 * 根据银行卡账号查询信息
	 * @param bankCardNumber
	 * @return
	 */
	@Override
	public UserBankcard selectUserBankcardByBankCardNumber(String bankCardNumber,String status) {
		return userBankcardMapper.selectUserBankcardByBankCardNumber(bankCardNumber,status);
	}

}
